<?php

class navigation_auto_cache extends auto_cache {

    private $key = "navigation";

    public function load($param) {
        $list = $GLOBALS['cache']->get($this->key);
        $list = false;
        if ($list === false) {
            $sql = "select * from " . DB_PREFIX . "navigation ORDER BY sort ASC";
            $list = $GLOBALS['db']->getAll($sql, true, true);
            $GLOBALS['cache']->set($this->key, $list);
        }

        return $list;
    }

    public function rm($param) {
        $GLOBALS['cache']->rm($this->key);
    }

    public function clear_all() {
        $GLOBALS['cache']->rm($this->key);
    }

}

?>